From: Michael Catanzaro Date: Mon, 20 Oct 2025 21:26:34 +0000 (-0500) Subject: networkAgent: Do not remove child watch source X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~44^2~169 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=961a7d721f3e4db9be6df958b10ba98955138cae;p=gnome-shell.git networkAgent: Do not remove child watch source The child watch source is the only thing that reaps the child process. We cannot remove it until it fires or the child will remain a zombie. So, just leave the source attached. Trying to remove it does not seem easy, and I don't see any need; we expect the child process to exit quickly, so this doesn't seem harmful. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7083 Part-of: --- diff --git a/js/ui/components/networkAgent.js b/js/ui/components/networkAgent.js index f3e7cdc80..3fad7cb81 100644 --- a/js/ui/components/networkAgent.js +++ b/js/ui/components/networkAgent.js @@ -473,7 +473,7 @@ class VPNRequestHandler extends Signals.EventEmitter { else this._readStdoutOldStyle(); - this._childWatch = GLib.child_watch_add(GLib.PRIORITY_DEFAULT, pid, + GLib.child_watch_add(GLib.PRIORITY_DEFAULT, pid, this._vpnChildFinished.bind(this)); this._writeConnection(); @@ -505,8 +505,6 @@ class VPNRequestHandler extends Signals.EventEmitter { return; this.emit('destroy'); - if (this._childWatch) - GLib.source_remove(this._childWatch); this._stdin.close(null); // Stdout is closed when we finish reading from it @@ -515,7 +513,8 @@ class VPNRequestHandler extends Signals.EventEmitter { } _vpnChildFinished(pid, status, _requestObj) { - this._childWatch = 0; + if (this._destroyed) + return; if (this._newStylePlugin) { // For new style plugin, all work is done in the async reading functions // Just reap the process here